home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / door / twrogue.zip / THIEF.BAS < prev    next >
BASIC Source File  |  1992-04-12  |  4KB  |  104 lines

  1. REM ********************************************************************
  2. REM *                                                                  *
  3. REM * Thief : a TRADEWARS 2002 v 1.3 utility for evil players          *
  4. REM *                                                                  *
  5. REM * Khalil E. Abu-Saba                                               *
  6. REM * 4/12/92                                                          *
  7. REM * Soquel BBS 408-462-6329                                          *
  8. REM *                                                                  *
  9. REM ********************************************************************
  10.  
  11. DIM robbed(1000), busted(1000), daterob$(1000, 2)
  12.  
  13. REM **** robbed(n) is listed of sectors robbed
  14. REM **** busted(n) is list of sectors that have busted you
  15. REM **** daterob(n,1)=last date robbed; (n,2)=last date busted
  16. REM **** Robbed.CSV is an ASCII file; each line has a sector number, followed
  17. REM **** by a comma, followed by the last date robbed
  18. REM ****
  19. REM **** Busted.CSV is an ASCII file; each line has a sector number, followed
  20. REM **** by a comma, followed by the last date you were busted there.
  21. REM ****
  22. REM **** Shiplog.csv keeps track of docking logs from all your ports of call
  23. REM **** Each line has the following items, separated by commas:
  24. REM **** Date of docking; time of docking, sector number, docking log
  25. REM **** The docking log is in the original text, i.e. "Frogface docked here
  26. REM **** 4 days ago"
  27.  
  28.  
  29. OPEN "robbed.csv" FOR INPUT AS 1
  30. WHILE NOT EOF(1)
  31.         INPUT #1, r
  32.         robbed(r) = 1
  33.         INPUT #1, daterob$(r, 1)
  34. WEND
  35. CLOSE 1
  36.  
  37. OPEN "busted.csv" FOR INPUT AS 1
  38. WHILE NOT EOF(1)
  39.         INPUT #1, b, daterob$(b, 2)
  40.         busted(b) = 1
  41. WEND
  42. CLOSE 1
  43.  
  44. INPUT "name of log file?"; n$
  45. OPEN n$ FOR INPUT AS 1
  46. OPEN "shiplog.csv" FOR APPEND AS 3
  47.  
  48. sec = 0
  49.  
  50. WHILE NOT EOF(1)
  51.         LINE INPUT #1, l$
  52.         REM ************* New Sector Information ***************************
  53.         IF INSTR(l$, "Sector  : ") = 1 THEN
  54.                 l1$ = RIGHT$(l$, LEN(l$) - 10)
  55.                 s = VAL(LEFT$(l1$, INSTR(l1$, " ")))
  56.                 hit = 0
  57.                 WHILE hit = 0
  58.                         LINE INPUT #1, l$
  59.                         IF INSTR(l$, "Warps to Sector") = 1 THEN
  60.                                 hit = 1
  61.                                 sec = s
  62.                         END IF
  63.                         IF LEN(l$) = 0 THEN
  64.                                 hit = 1
  65.                         END IF
  66.                 WEND
  67.         END IF
  68.         REM **************** upadate dat$ and tim$
  69.         IF INSTR(l$, "Commerce report") = 1 THEN
  70.                 colon = INSTR(l$, ":")
  71.                 dat$ = MID$(l$, colon + 1, 9)
  72.                 tim$ = MID$(l$, colon + 10, 11)
  73.         END IF
  74.         REM **************** extract recent player activities **********
  75.         IF INSTR(l$, "docked") > 0 THEN
  76.                 PRINT #3, dat$; ","; tim$; ","; s; ","; l$
  77.         END IF
  78.  
  79.         REM ******************* Ports Robbed *****************
  80.         IF INSTR(l$, "Success!") > 0 THEN
  81.                 robbed(sec) = 1
  82.                 daterob$(sec, 1) = dat$
  83.         END IF
  84.        
  85.         REM ****************** Ports Busted ******************
  86.         IF INSTR(l$, "Busted!") > 0 THEN
  87.                 busted(sec) = 1
  88.                 daterob$(sec, 2) = dat$
  89.         END IF
  90. WEND
  91. CLOSE 1
  92. CLOSE 3
  93.  
  94. OPEN "robbed.csv" FOR OUTPUT AS 2
  95. OPEN "busted.csv" FOR OUTPUT AS 3
  96.  
  97. FOR i = 1 TO 1000
  98.         IF robbed(i) > 0 THEN PRINT #2, i; ","; daterob$(i, 1)
  99.         IF busted(i) > 0 THEN PRINT #3, i; ","; daterob$(i, 2)
  100. NEXT i
  101. CLOSE 2
  102. CLOSE 3
  103.  
  104.